import { Component, Inject, OnInit } from '@angular/core';
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
import { userInfoData } from 'src/app/date/userInfodata';
import { UserInfoService } from 'src/app/services/user-info.service';

@Component({
  selector: 'app-userinfoedit',
  templateUrl: './userinfoedit.component.html',
  styleUrls: ['./userinfoedit.component.css']
})
export class UserinfoeditComponent implements OnInit {

  constructor(@Inject(MAT_DIALOG_DATA) public userdata: userInfoData,private useredit:UserInfoService) { }

  ngOnInit(): void {
  }

  userinfo:userInfoData=this.userdata

  userinfoedit(){
    this.useredit.useredit(this.userinfo).subscribe(
      data=>{
        if(data){
          alert("修改成功")
        }else{
          alert("修改失败")
        }
      }


    )
  }


}
